<?php
require_once("auth/sso.php");
$sso = new SingleSignOn_Broker();
$users = $sso->getInfo();

if (!$users) {
    header("Location:login.php", true, 307);
    exit;
}

$user_active = $users["identity"];
require_once('user_assets.php');
$features = $privilege->getFeatures($user->role_id,1);

require_once('app_common.php');
?>
<!DOCTYPE html>
<!-- saved from url=(0047)https://secure.fleetio.com/453a3e08f1/dashboard -->
<html lang="en">
   <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Autogator</title>
<!--[if lt IE 9]>
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
       
       <script type="text/javascript" src="lib/jquery-1.7.1.min.js"></script>	
	
		<script type="text/javascript" src="lib/objs-2.1.1-min.js"></script>
		<script type="text/javascript" src="lib/puremvc-objs-2.0-min.js"></script>
		<script type="text/javascript" src="lib/bootstrap-datepicker.js"></script>
		
		<script type="text/javascript" src="src/abc/MediatorNames.js"></script>
		<script type="text/javascript" src="src/abc/NotificationNames.js"></script>
		<script type="text/javascript" src="src/abc/ProxyNames.js"></script>
        <script type="text/javascript" src="src/abc/AppConstant.js"></script>
		<script type="text/javascript" src="src/controller/PrepModelCommand.js"></script>
		<script type="text/javascript" src="src/controller/PrepViewCommand.js"></script>
		<script type="text/javascript" src="src/controller/StartupCommand.js"></script>
	    <script type="text/javascript" src="src/view/components/UiComponent.js"></script>
		<script type="text/javascript" src="src/abc/NotificationNames.js"></script> 
		<script type="text/javascript" src="src/abc/ProxyNames.js"></script> 
		
		<!--START:Mediators and components-->
		<script type="text/javascript" src="src/view/HomePageMediator.js"></script>
		<script type="text/javascript" src="src/view/components/HomePage.js"></script>
        <script type="text/javascript" src="src/view/ReportsPageMediator.js"></script>
		<script type="text/javascript" src="src/view/components/ReportsPage.js"></script>
		<!--END:Mediators and components-->
		
		<!--START:Proxies-->
		<script type="text/javascript" src="src/model/VehicleProxy.js"></script> 
		<!--END:Proxies-->
		
		<script type="text/javascript" src="src/ApplicationFacade.js"></script>
       
		<link href="css/application.css" media="screen" rel="stylesheet" type="text/css">
		<link href="css/datepicker.css" media="screen" rel="stylesheet" type="text/css">
		
		<!--date picker-->
		<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
		<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
		<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
		<!--<link rel="stylesheet" href="/resources/demos/style.css" />-->
	
	
<!--[if IE]>
<meta content='IE=7' http-equiv='X-UA-Compatible' />
<![endif]-->
<!--[if lt IE 8]>
<link href="/assets/ie-08bbde2ff631bdbfa50c86f9bf62845b.css" media="screen" rel="stylesheet" type="text/css" />
<![endif]-->

<!--
Version 12.9.1
-->




<script type="text/javascript">
      				
	$().ready(function()
	 {              

	    var userType = '<?php echo $users["identity"];?>';
		if(userType == 2)
		{
			$('#dvUnderConstruction').hide();
			$('#root').show();
		}
		else
		{
			$('#dvUnderConstruction').show();
			$('#root').hide();
		}
		
		
	//	$("#cnameheader").html(global_user.admin_companyname); 
	//	$("#adminnameheader").html(global_user.admin_name);

		if( document.location.hash )
			document.location.hash = "";
		var applicationFacade/*ApplicationFacade*/ = ApplicationFacade.getInstance();
			applicationFacade.startup( $("body") );
			
		$('#fromDate')
			.datepicker()
			.on('changeDate', function(ev){
				if (ev.date.valueOf() > endDate.valueOf()){
					$('#alert').show().find('strong').text('The start date must be before the end date.');
				} else {
					$('#alert').hide();
					startDate = new Date(ev.date);
					$('#date-start-display').text($('#date-start').data('date'));
				}
				$('#date-start').datepicker('hide');
			});
		
		$('#toDate').datepicker();

		$( "#inpFromDate" ).datepicker();
		$( "#inpToDate" ).datepicker();
		
	 }); 
</script>    
   
</head>

 <script src="js/bootstrap-twipsy.js"></script>
   <!--  <script src="js/bootstrap-datepicker.js"></script> -->
    <script src="js/bootstrap.min.js"></script>
    <script type="text/javascript"> current_page = "reports";</script>
	
<body>
	

	<div id="dvUnderConstruction" class="form-actions" align="center">
		<h3> Page Under Construction </h3>
	</div>
	
    <div id="root">
		<div id="wrapper">
            <?php include_once $header_path; ?>
			<!--<div id="reports" class="form-actions" style="  text-align: center;">
				<h3>This Page Under Construction</h3>
				<br/>                
            </div>-->
			<div class="container">
				<div class="block" style="margin-top:30px">
					<div class="block_head"> 
						<div class="bheadl"></div>
						<div class="bheadr"></div>
						
							<h3 style="margin-top:12px;float:left"> Reports <small></small> </h3> 
							<a id="btn_refresh" class="btn" style="float:right;margin-top:12px">
								<i class="icon-refresh"></i>
							</a>
							
							
					</div> 
					
					<div class="block_content">
						<!--START:Date picker-->
						<!--<div class="input-append date" id="fromDate" data-date-format="dd-mm-yyyy" style="float:left;">
							<input id="inpFromDate" size="16" type="text"  readonly>
							<span class="add-on"><i class="icon-th"></i></span>
						</div>
						<div class="input-append date" id="toDate" data-date-format="dd-mm-yyyy"  style="float:left;margin-left:10px;">
							<input id="inpToDate" size="16" type="text" readonly>
							<span class="add-on"><i class="icon-th"></i></span>
						</div>-->
						<input id="inpFromDate" type="text" style="float:left;"/>
						<input id="inpToDate" type="text" style="float:left;margin-left:10px;"/>
						
						<!--<input id="inpFromDate" class="input" type="date" size="16"  style="float:left;">
						<input id="inpToDate" class="input" type="date" size="16" style="float:left;margin-left:10px;">-->
						<button id="btnGetReports" class="btn btn-primary" style="float:left;margin-left:10px">Go</button>
						<!--END:Date picker-->
						
						<!--START:Report table-->
						<div style="height:400px; overflow:auto;clear:both">
							<table class="table table-outer-bordered" id="table_reports" style="font-size:12px">
								<thead>
									<tr>
										<th>Date</th>
										<th>Seller(Via Web Application)</th>
										<th>Seller(Via Mobile Application)</th>
										<th>Buyer(Via Web Application)</th>
										<th>Buyer(Via Mobile Application)</th>
									</tr>
								</thead>
							</table>
						</div>
						<!--END:Report table-->
						
						<!--START:Count-->
						<div class="form-actions">
                                                     
                                                        <div class="row-fluid">
                                                           
                                                              
                                                            <div class="span2" style="float:right">
                                                                <div class="ac stat-block" style="margin-bottom:0">
                                                                <h3 id="lblSellerViaWeb">0</h3>

                                                                <h6 class="stat-heading">Seller(Via WA)</h6>
                                                                </div>
                                                            </div>
                                                            <div class="span2" style="float:right">
                                                                <div class="ac stat-block" style="margin-bottom:0">
                                                                <h3 id="lblSellerViaMob">0</h3>

                                                                <h6 class="stat-heading">Seller(Via MA)</h6>
                                                                </div>
                                                            </div>
                                                            <div class="span2" style="float:right">
                                                                <div class="ac stat-block" style="margin-bottom:0">
                                                                <h3 id="lblBuyerViaWeb">0</h3>

                                                                <h6 class="stat-heading">Buyer(Via WA)</h6>
                                                                </div>
                                                            </div>
                                                            <div class="span2" style="float:right">
                                                                <div class="ac stat-block" style="margin-bottom:0">
                                                                <h3 id="lblBuyerViaMob">0</h3>

                                                                <h6 class="stat-heading">Buyer(Via MA)</h6>
                                                                </div>
                                                            </div> 
                                                        </div>
                                                     
                                                </div>
												
						<!--<div>	
						
							<div  style="float:left;">
								<label style="float:left;">Seller(Via WA) :</label>
								<label id="lblSellerViaWeb" style="float:left;"></label>
								<label style="float:left;margin-left:10px">Seller(Via MA) :</label>
								<label id="lblSellerViaMob" style="float:left;"></label>
							</div>
							<div  style="float:right;">
								<label id="lblBuyerViaMob" style="float:right;"></label>
								<label style="float:right">Buyer(Via MA) :</label>
								<label id="lblBuyerViaWeb" style="float:right;margin-right:10px;"></label>
								<label style="float:right;">Buyer(Via WA) :</label>
								
							</div>
						</div>-->		
						<!--END:Count-->
						
						
					</div>
					
				</div>  
			</div>
        </div>
    </div>
</body>
</html>